﻿﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace finProj.Entities
{
    public class FeatureVector
    {
        private float[] FeatureVec;
        public Dictionary<string, double> features;

        private int SizeOfVector;

   
        public FeatureVector()
        {
            features = new Dictionary<string, double>();
            //create featureVector using algorithm
        }
        public int Change_featurevectors_keys(double[] s)
        {
           
            features["InnerEyeDistance"] = s[0];
            features["OuterEyeDistance"] = s[1];
            features["Nose-LeftEye"] = s[2];
            features["Nose-RightEye"] = s[3];
            features["Mouth-LeftEye"] = s[4];
            features["Mouth-RightEye"] = s[5];
            features["Nose-Mouth"] = s[6];
            return (1);
        }
        public float[] GetVector()
        {
            return this.FeatureVec;
        }
        public int GetSize()
        {
            //return this.SizeOfVector;
            return features.Count;
        }
        public double[] Get_only_key_from_featuresavector()
        {
            double[] temp=new double[GetSize()];
            int i = 0;
            
             foreach (KeyValuePair<string, double> feature in features)
             {
                 temp[i] = feature.Value;
             }
            return (temp);
        }
        public string getFeatureVec()
        {
            var sb = new StringBuilder();
            foreach (KeyValuePair<string, double> feature in features)
            {
                sb.AppendLine((string.Format("{0}, value= {1} ", feature.Key, string.Format("{0:0.####}", feature.Value))));
            }
            return sb.ToString();

        }


    }
}